import express from 'express'
import brandController from '@/controllers/brandController'
import roleAuth from '@/middlewares/role-auth'

const router = express.Router()

/**
 * 查询品牌列表
 * GET /brands
 */

router.get('/', roleAuth, brandController.getBrands)

/**
 * 新增品牌
 * POST /brands
 */
router.post('/', roleAuth, brandController.addBrand)

/**
 * 查询品牌详情
 * GET /brands/:id
 */
router.get('/:id', roleAuth, brandController.getBrandInfo)

/**
 * 更新品牌
 * PUT /brands/:id
 */
router.put('/:id', roleAuth, brandController.updateBrand)

/**
 * 删除品牌
 * DELETE /brands/:id
 */
router.delete('/:id', roleAuth, brandController.deleteBrand)

export default router
